# Maintainer: Campbell Jones <arch at serebit dot com>
# Contributor: Fabio 'Lolix' Loli <fabio.loli@disroot.org> -> https://github.com/FabioLolix
# Contributor: Stefano Capitani <stefanoatmanjarodotorg>
# Contributor: Florian Pritz <f-p@gmx.at>

pkgname=inxi
_pkgver=3.3.26-1
pkgver=${_pkgver//-/.}
pkgrel=1
pkgdesc="Full featured CLI system information tool"
arch=(any)
url="https://smxi.org/docs/inxi.htm"
license=(GPL3)
depends=(coreutils pciutils perl procps-ng util-linux)
optdepends=(
    "bind: dig: -i wlan IP"
    "binutils: strings: -I sysvinit version"
    "bluez-tools: bt-adapter: -E bluetooth data (if no hciconfig)"
    "curl: -i (if no dig); -w,-W; -U"
    "dmidecode: -M if no sys machine data; -m"
    'doas: -Dx hddtemp-user; -o file-user (alt for sudo)'
    "file: -o unmounted file system (if no lsblk)"
    "freeipmi: ipmi-sensors: -s IPMI sensors (servers)"
    "hddtemp: -Dx show hdd temp, if no drivetemp module"
    "iproute2: ip: -i ip LAN"
    "kmod: modinfo: Ax; -Nx module version"
    "ipmitool: -s IPMI sensors (servers)"
    "lvm2: lvs: -L LVM data"
    "lm_sensors: sensors: -s sensors output"
    "mdadm: -Ra advanced mdraid data"
    "mesa-utils: glxinfo: -G (X) glx info"
    "net-tools: ifconfig: -i ip LAN (deprecated)"
    "perl-cpanel-json-xs: Cpanel::JSON::XS: --output json (faster than JSON::PP)"
    "perl-json-xs: JSON::XS: --output json (legacy)"
    "perl-io-socket-ssl: IO::Socket::SSL: -U; -w,-W; -i (if dig not installed)"
    "smartmontools: smartctl: -Da advanced data"
    "systemd-sysvcompat: -I runlevel"
    "sudo: -Dx hddtemp-user; -o file-user"
    "tree: --debugger 20,21 /sys tree"
    "upower: -sx attached device battery info"
    "usbutils: lsusb: -A usb audio; -J (optional); -N usb networking"
    "wget: -i (if no dig); -w,-W; -U"
    "wmctrl: -S active window manager (fallback)"
    "xorg-xdpyinfo: xdpyinfo: -G (X) Screen resolution, dpi; -Ga Screen size"
    "xorg-xdriinfo: xdriinfo: -G (X) DRI driver (if missing, fallback to Xorg log)"
    "xorg-xprop: xprop: -S (X) desktop data"
    "xorg-xrandr: xrandr: -G (X) monitors(s) resolution; -Ga monitor data"
)
source=("$pkgname-$pkgver.tar.gz::https://github.com/smxi/$pkgname/archive/refs/tags/${_pkgver}.tar.gz")
sha256sums=('9c76b90044a5840d9e32fd83d1b3c1bb0d7c39c89904ac387cf6be339785451e')

package() {
    cd "$pkgname-${_pkgver}"

    install -Dm 00755 $pkgname "${pkgdir}/usr/bin/$pkgname"
    install -Dm 00644 $pkgname.1 "${pkgdir}/usr/share/man/man1/$pkgname.1"
}
